home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CUCD / Programming / AMOSList / AMOSLIST / text0081.txt < prev    next >
Encoding:
Text File  |  1998-04-01  |  1.9 KB  |  57 lines

  1. On 08-Mar-98, mg40067 smashed the keyboard with:
  2. > Here my problem.  short example
  3. > --text.txt look like this--
  4. > 5
  5. > 8
  6. > --end text
  7. > r$="text.txt"
  8. > open in 1,r$ : a=lof(1) : close 1
  9. > reserve as work 16,a
  10. > bload r$,16
  11. > abc=start(16)
  12. > c1=peek(abc) : inc abc : c2=peek(abc)
  13. > print c1         : rem gives the ascii value
  14. > print chr$       : show numer 5
  15. > Ok how will do to make amos to understand that i want to threat this
  16. > as a number instead of an ascii value?
  17. > Is there anyway to convert that 5 (53) so 
  18. > i can use it like this
  19. > tal=c1+c2 
  20. > print tal      : want it to be 13
  21. > please help me...
  22.  
  23. Just one thing, You have shown in your text that you have a line-feed
  24. between the numbers, if you have that you should use this way to get
  25. the data:
  26.  
  27. S=Start(BNK)
  28. C1$=Peek$(S,100,Chr$(10)) : Add S,Len(C1$)+1
  29. C2$=Peek$(S,100,Chr$(10))
  30. C1=Val(C1$) : C2=Val(C2$)..
  31.  
  32. If you have number as you write above then this should work:
  33. C_VALUE=Val(Chr$(C_ASCII)) 
  34. -- 
  35. Kind regards from
  36. ______________________________________________________________________________
  37.  /_  __/ __  / __  /\  ___\  __ \__  _\               aka. JENS VANG PETERSEN
  38.   / / / /_/ / ____/  \ \___\  __ \ \ \                  top_cat@post8.tele.dk
  39.  /_/ /_____/_/        \_____\_\ \_\ \_\
  40. ------------------------------------------------------------------------------
  41.                     http://home8.inet.tele.dk/top_cat/
  42.   -+-    Home of 'The Ultimate Extension list' for AMOS TC & AMOS PRO    -+-
  43.                  -+-  SUPPORT - AMOS - AMIGA - AQUA  -+-
  44. ------------------------------------------------------------------------------
  45.  I know not with what weapons World War III will be fought, but  World  War  IV
  46.  will be fought with sticks and stones.
  47.                                                            -- Albert Einstein
  48. ------------------------------------------------------------------------------
  49.  
  50.  
  51.